package Interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

import javax.servlet.http.HttpServletResponse;

/**
 * Created by chenzui on 2017/5/5.
 */
public class AccessInterceptor implements Interceptor {
    public void intercept(Invocation invocation) {
        HttpServletResponse response =invocation.getController().getResponse();
        response.addHeader("Access-Control-Allow-Origin","*");
        response.setContentType("application/json");
        response.setCharacterEncoding("UTF-8");
        invocation.invoke();
    }

}
